<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <input type="text" v-model="msg">
  </div>
  <script src="../js/vue.js"></script>
  <script>
    /* 
      主要阶段
        1.挂载:
          beforeCreate
          created
          beforeMount
          mounted(准备，安排)
        2.更新
          beforeUpdate
          updated
        3.销毁
          beforeDestroy
          destroyed
        4.组件状态
          activated  活跃状态
          deactivated  不活跃状态
     */
    const vm = new Vue({
      "el": "#app",
      "data": {
        "msg": "消息"
      },
      beforeCreate() {
        console.log(`beforeCreate...`);
      },
      created() {
        console.log(`create...`);
      },
      beforeMount() {
        console.log(`beforeMount`);
      },
      mounted() { //这个比较重要
        console.log(`mounted...`);
      },
      beforeUpdate() {
        console.log(`beforeUpdate...`);
      },
      updated() {
        console.log(`updated...`);
      },
      beforedestroy() {
        console.log(`beforedestroy`);
      },
      destroyed() {
        console.log(`destroyed...`);
        // this.$destroyt();
      },
      activated() {

      },
      deactivated() {

      },
      "methods": {},
      "directives": {},
      "computed": {},
      "watch": {},
      "filters": {}
    });
  </script>
</body>

</html>